var t1,t2,t3,t4;
function AlertInfo(option){//弹出窗
	clearTimeout(t1);
	clearTimeout(t2);
	clearTimeout(t3);
	clearTimeout(t4);
	if($("#Transbg").length>0 && $("#alertbox").length>0){
	    $("#Transbg").remove();
	    $("#alertbox").remove();
	}
    if(option==null || option=="undefind"){
        option={
            width:'90%',
            titleOr:'true',//是否显示弹出窗标题
            title:'提示信息',//标题名字
            autoHidden:'true',//弹出窗是否自动隐藏
            hiddenTime:2000,//弹出窗隐藏定时器
            textAlign:'center',//内容文本居中、居右、居左
            content:'系统异常，请稍后重试！'//提示信息内容（文本/html）
        }           
    }
   
    var width=option.width?option.width:"90%";
    var titleOr=option.titleOr?option.titleOr:"true";
    var title=option.title?option.title:"提示信息";
    var autoHidden=option.autoHidden?option.autoHidden:"true";
    var hiddenTime=option.hiddenTime?option.hiddenTime:2000;
    var textAlign=option.textAlign?option.textAlign:"center";
    var content=option.content?option.content:"系统异常，请稍后重试！";

    var bgHtml="";
    var alertBox="";
    bgHtml="<div id=\"Transbg\" class=\"transbg\" style=\"display:none\"></div>";
    alertBox+="<div id=\"alertbox\" class=\"alertbox\" style=\"display:none\">";
    if(titleOr=="true"){
        alertBox+="<div class=\"title\">";
        alertBox+="    <h2>"+title+"</h2>";
        if(autoHidden!="true"){
            alertBox+="   <span>×</span>";
        }
        alertBox+="</div>";
    }
    alertBox+=" <div class=\"content\">";
    alertBox+=content;
    alertBox+=" </div>";
    alertBox+="</div>";
    $("body").append(bgHtml);
    $("body").append(alertBox);
    $("#Transbg").fadeIn(300);
    $("#alertbox").fadeIn(300);    
    var height=$("#alertbox").height();
    width=width.split("%");
    width=width[0];
    $("#alertbox").css({"width":width+"%","margin-left":"-"+width/2+"%","margin-top":"-"+(height/11)*10+"px"});
    $("#alertbox .content").css("textAlign",textAlign);
    $("#Transbg").bind("click",function(){
        $("#Transbg").fadeOut(300);
        $("#alertbox").fadeOut(300);
        t1=setTimeout(
            function(){
                $("#Transbg").remove();
                $("#alertbox").remove();
                
            },300
        );
        content=""; 
    });   
    if(autoHidden=="true"){
        t2=setTimeout(
            function(){
                $("#Transbg").fadeOut(300);
                $("#alertbox").fadeOut(300);
            },hiddenTime
        );
        t3=setTimeout(
            function(){
                $("#Transbg").remove();
                $("#alertbox").remove();
            },hiddenTime+300
        );
        content="";
    }
    if(autoHidden!="true"){
        $("#alertbox .title span").bind("click",function(){
            $("#Transbg").fadeOut(300);
            $("#alertbox").fadeOut(300);
            t4=setTimeout(
                function(){
                    $("#Transbg").remove();
                    $("#alertbox").remove();
                },300
            );    
            content=""; 
        });                
    }
}